
library(lfe)
library(stargazer)


########## LOADS the Manifesto data with the scores of ideology and the party families; 
## for the definitions and calculation of the ideology scores, see Colantone, Italo, and Piero Stanig. "The trade origins of economic nationalism: Import competition and voting behavior in Western Europe." American Journal of Political Science 62, no. 4 (2018): 936-953.

load(file="TableS8data.RData")

## estimate models with ideology as outcome variable, by party family, with country-year (election) fixed effects and standard errors clustered by country-year (election).

mod1<- felm(lowe.net.autarky~mainstream.left+radical_left+radical.right| countryyear|0|countryyear, data=cmp, subset=year>1998&year<2016&(mainstream.right+mainstream.left+radical.right+radical_left)>0)

mod2 <- felm(lowe.nationalist~mainstream.left+radical_left+radical.right| countryyear|0|countryyear, data=cmp, subset=year>1998&year<2016&(mainstream.right+mainstream.left+radical.right+radical_left)>0)

mod3 <- felm(lowe.econleftright~mainstream.left+radical_left+radical.right| countryyear|0|countryyear, data=cmp, subset=year>1998&year<2016&(mainstream.right+mainstream.left+radical.right+radical_left)>0)

stargazer(mod1,  mod2,  mod3, out="TableS8Raw.tex")

stargazer(mod1,  mod2,  mod3, type="text", out="TableS8RawTEXT.txt")